package com.blackfish.factory;

import com.blackfish.bag.BagService;
import com.blackfish.common.model.Bag;
import com.blackfish.common.model.User;
import com.jfinal.plugin.redis.Redis;
import sun.misc.Cache;

public class FactoryService {
    static final BagService bagServer = new BagService();
    public void mkidr(String path) {

    }

    public void rmdir(String path) {

    }

    public void getJson(String Name) {

    }

    public void initDevice() {

    }

    public int createBag(String bagName,String dir,User user) {
        boolean isCreate = false;
        Bag bag = bagServer.createBag(bagName);
        isCreate = bagServer.createBleong(bag.getId(),user.getId(),dir);
        if(isCreate)
            return bag.getId();
        else{
            return 0;
        }
    }
}
